package com.topvision.service.impl;

import com.topvision.domain.Device;
import com.topvision.dto.DeviceDTO;
import com.topvision.repository.DeviceRepository;
import com.topvision.service.DeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class DeviceServiceImpl implements DeviceService {

    @Autowired
    private DeviceRepository deviceRepository;

    @Override
    public List<Device> findByCreatedBy(String name) {
        return deviceRepository.findByCreatedBy(name);
    }

    @Override
    public void save(Device device) {
        deviceRepository.save(device);
    }

    @Override
    public void delete(Long id) {
        deviceRepository.delete(id);
    }

    @Override
    public List<Device> findByUserName(String username) {
        return deviceRepository.findByUserName(username);
    }

    @Override
    public Device findByBtMac(String btmac) {
        return deviceRepository.findByBtMac(btmac);
    }
}
